//
//  HomeModels.swift
//  LongTermInsurance
//
//  Created by zolobdz on 2018/11/24.
//  Copyright © 2018年 HeChao. All rights reserved.
//

import UIKit
import ObjectMapper

class NotifyModel: NSObject,Mappable {
    
    var notifyNO = 0.0
    var type = ""
    var title = ""
    var readCount = 0
    var date = ""
//    {"NoticeNo":19.0,"NoticeType":"通知","NoticeTitle":"11","ReadNum":32.0,"NoticeDate":"2018-02-05T15:25:03"}
    required init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        notifyNO <- map["noticeno"]
        type <- map["noticetype"]
        title <- map["noticetitle"]
        readCount <- map["readnum"]
        date <- map["noticedate"]
    }
}

class NotifyDetailModel: NSObject,Mappable {
    
//    var notifyNO = 0.0
//    var type = ""
    var title = ""
    var readCount = 0
    var date = ""
    var content = ""
    //    {"NoticeNo":19.0,"NoticeType":"通知","NoticeTitle":"11","ReadNum":32.0,"NoticeDate":"2018-02-05T15:25:03"}
    required init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
//        notifyNO <- map["NoticeNo"]
        title <- map["noticetitle"]
        readCount <- map["readnum"]
        date <- map["noticedate"]
        content <- map["notice"]
        
    }
}


@objcMembers class BannerModel: NSObject{
    
    var img = ""
    var url = ""
    // {"NAME":"姓名","Sex":"性别","UserId":"身份证","PersonNum":"个人编号","PerCardNum":"社保卡号"}
    
}


class CareOrgModel: NSObject,Mappable,PickerProtocol {
    
    var id = 0
    var name = ""
    var showName: String {
        return name
    }
    //    {"NoticeNo":19.0,"NoticeType":"通知","NoticeTitle":"11","ReadNum":32.0,"NoticeDate":"2018-02-05T15:25:03"}
    required init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
//        id <- map["OrgNo"]
//        name <- map["OrgName"]
        id <- map["orgno"]
        name <- map["orgname"]
    }
}

class HomeCareModel: NSObject,Mappable,PickerProtocol {
    
    var id = 0
    var name = ""
    var showName: String {
        return name
    }
    required init?(map: Map) {
        
    }
    func mapping(map: Map) {
//        id <- map["ORGNO"]
//        name <- map["ORGNAME"]
//        if name.count == 0 {
//            id <- map["OrgNo"]
//            name <- map["OrgName"]
//        }
        id <- map["orgno"]
        name <- map["orgname"]
    }
}
